<%@page import="com.infolab.aims.domain.purchase.PurchaseOrder"%>
<%@ include file="/WEB-INF/views/taglib.jsp" %>

 <c:url value="/monthEndClosing/search" var="paginationUrl"></c:url>
 <div>
 <h3 class="left">Month End Closing Search</h3>


<a href="<c:url value="/monthEndClosing/create?status=freeze" />" class="button right">
	 <img align="absmiddle" src="${imageUrl}/icon_add.png">Create Month End Closing
</a>
 <a onclick="$('.searchCriteria').toggle();" class="button right">
	 <img align="absmiddle" src="${imageUrl}/icon_detail.png"> Toggle Search Criteria
</a>
</div>
<div class="clear"></div>
 <form:form id="form" method="get" modelAttribute="searchCriteria" cssClass="simpleForm">
 <jsp:include page="/WEB-INF/views/message.jsp"></jsp:include>
 <div class="searchCriteria">
 <fieldset>
 	<legend>Search Criteria</legend>
	<p>
	<form:label path="search['assetBalanceMonth']" >
	Month  
	</form:label> 
	<form:input path="search['assetBalanceMonth']"/>
	</p>
	
	<p>
	<form:label path="search['assetBalanceYear']" >
	Year
	</form:label> 
	<form:input path="search['assetBalanceYear']" />
	</p>
	
</fieldset>
	<p class="right">
	  	<button type="submit" class="button positive">Search</button>
	 </p>
 </div>
 </form:form>	
 <div class="clear"></div>
 <fieldset>
 	<legend>Search Result</legend>
 	<c:choose>
 		<c:when test="${fn:length(searchResult) < 1}">
 		<div class="notice">
 		<span class="ui-icon ui-icon-info left marginright5"></span>
 		No records </div>
 		</c:when>
 	<c:otherwise>
 <table class="gridSearch">
 <thead>	
 	<tr>
 		<th>S/N</th>
 		<th>
 		<label>Month</label>
 		</th>
 		<th>
 		<label>Year</label>
 		</th> 	
 		
 		<th>
 		<label>Modified By</label>
 		</th>
 		
 		<th>
 		<label>Modified On</label>
 	</tr>
 </thead>
 <tbody>
 	
 	<c:forEach items="${searchResult}" var="result" varStatus="status">
 	<tr <c:if test="${(status.count%2)==0 }"> class="alt"</c:if>>
 		<td>${status.count}</td>
 		<td>${result.assetBalanceMonth}</td>
 		<td>${result.assetBalanceYear}</td>
 		<td>${result.lastModifiedBy}</td>
 		<td>${result.lastModifiedDate}</td>

 	</tr>
 	</c:forEach>
 	
 </tbody>

 
 </table>
 </c:otherwise>
 </c:choose>
  </fieldset>
  
  
<script type="text/javascript">
		$(document).ready(function() {
			$('.searchCriteria').hide();
		});
</script>